package com.example.project.entity;

import java.time.LocalDateTime;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.example.project.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 问题变更历史主，记录Issue等对象的变更信息对象 t_journals
 * 
 * @author ruoyi
 * @date 2025-09-26
 */
public class Journal extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/** 主键ID */
	private Long id;

	/** 被记录对象的ID（如Issue ID） */
	private Long journalizedId;

	/** 被记录对象的类型（如"Issue"） */
	private String journalizedType;

	/** 操作用户ID */
	private Long userId;

	/** 变更笔记内容，支持长文本 */
	private String notes;

	/** 是否私有笔记：0=公开，1=私有 */
	private Integer privateNotes;

	/** 记录创建时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime createdOn;

	/** 最后更新时间 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime updatedOn;

	/** 最后更新用户ID */
	private Long updatedById;

	private String updatedByName;

	private List<JournalDetail> detailList;

	private String timeSinceCreation;

	private List<Attachment> attachmentList;

	public Journal() {
	}

	public Journal(String journalizedType, Long journalizedId, Long userId) {
		super();
		this.journalizedId = journalizedId;
		this.journalizedType = journalizedType;
		this.userId = userId;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setJournalizedId(Long journalizedId) {
		this.journalizedId = journalizedId;
	}

	public Long getJournalizedId() {
		return journalizedId;
	}

	public void setJournalizedType(String journalizedType) {
		this.journalizedType = journalizedType;
	}

	public String getJournalizedType() {
		return journalizedType;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public String getNotes() {
		return notes;
	}

	public void setPrivateNotes(Integer privateNotes) {
		this.privateNotes = privateNotes;
	}

	public Integer getPrivateNotes() {
		return privateNotes;
	}

	public void setCreatedOn(LocalDateTime createdOn) {
		this.createdOn = createdOn;
	}

	public LocalDateTime getCreatedOn() {
		return createdOn;
	}

	public void setUpdatedOn(LocalDateTime updatedOn) {
		this.updatedOn = updatedOn;
	}

	public LocalDateTime getUpdatedOn() {
		return updatedOn;
	}

	public void setUpdatedById(Long updatedById) {
		this.updatedById = updatedById;
	}

	public Long getUpdatedById() {
		return updatedById;
	}

	public String getUpdatedByName() {
		return updatedByName;
	}

	public void setUpdatedByName(String updatedByName) {
		this.updatedByName = updatedByName;
	}

	public List<JournalDetail> getDetailList() {
		return detailList;
	}

	public void setDetailList(List<JournalDetail> detailList) {
		this.detailList = detailList;
	}

	public String getTimeSinceCreation() {
		return timeSinceCreation;
	}

	public void setTimeSinceCreation(String timeSinceCreation) {
		this.timeSinceCreation = timeSinceCreation;
	}

	public List<Attachment> getAttachmentList() {
		return attachmentList;
	}

	public void setAttachmentList(List<Attachment> attachmentList) {
		this.attachmentList = attachmentList;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
				.append("journalizedId", getJournalizedId()).append("journalizedType", getJournalizedType())
				.append("userId", getUserId()).append("notes", getNotes()).append("privateNotes", getPrivateNotes())
				.append("createdOn", getCreatedOn()).append("updatedOn", getUpdatedOn())
				.append("updatedById", getUpdatedById()).toString();
	}

}
